<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>注册</title>
    <style>
        .error {
            color: red;
            margin: 10px 0;
        }
        .success {
            color: green;
            margin: 10px 0;
        }
    </style>
</head>
<body>
<h2>用户注册</h2>

<!-- 显示成功消息 -->
<div th:if="${successMessage}" class="success">
    <p th:text="${successMessage}"></p>
</div>

<!-- 显示错误消息 -->
<div th:if="${errorMessage}" class="error">
    <p th:text="${errorMessage}"></p>
</div>

<form th:action="@{/user/create}" method="post">
    <div>
        <label>用户名：</label>
        <input type="text" name="username" required />
    </div>
    <div>
        <label>密码：</label>
        <input type="password" name="password" required />
    </div>
    <div>
        <button type="submit">注册</button>
    </div>
</form>
<div>
    <a th:href="@{/login}">返回登录</a>
</div>
</body>
</html>